//
// Created by mio on 25-5-9.
//

#ifndef LOGINCONNECTION_H
#define LOGINCONNECTION_H

#include "define.h"
#include "../Net/TcpConnection.h"

class LoginConnection : public TcpConnection
{
public:
    LoginConnection(TaskScheduler* scheduler, int socket);
    ~LoginConnection();

protected:
    bool IsTimeout(uint64_t timestamp);
    bool OnRead(BufferReader& buffer);
    void HandleMessage(BufferReader& buffer);
    void Clear();

private:
    void HandleRegister(const packet_head* data);
    void HandleLogin(const packet_head* data);
    void HandleDestory(const packet_head* data);
};



#endif //LOGINCONNECTION_H
